
function Field(name, type, mandatory)
{
	this.name = name;
	this.type = type;
	this.mandatory = mandatory;
}

function Wizard(baseUrl, language, applicationPath)
{
	this.baseUrl = baseUrl;
	this.language = language;
	this.applicationPath = applicationPath;
	this.xmlHttp = null;
	this.wizardDocument = null;
	this.contextDocument = null;
	this.currentStep = 0;
	this.steps = null;
	this.currentFields = null;
	this.complete = false;
	this.result = null;
	this.bFinish2 = false;
	this.bFinish3 = false;
}

Wizard.prototype.Initialize = function ()
{
	try
	{
		this.xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
	}
	catch(e)
	{
		alert(e);
		this.xmlHttp = null;
	}

	return (this.xmlHttp != null);
}

Wizard.prototype.LoadWizard = function (url)
{
	var result;
	var title;
	var finishAction;
	var contextNode;
	
	result = null;
	
	if(this.xmlHttp == null)
	{
		if (!this.Initialize())
		{
			return false;
		}
	}

	result = new ActiveXObject("Msxml2.DOMDocument");

	result.async = false;
	if (url.charAt(0) == '/')
	{
		result.load(url);
	}
	else
	{
		result.load(this.baseUrl + url);
	}

	if (result.parseError.errorCode != 0)
	{
		result = null;
		
		return false;
	}
	
	this.wizardDocument = result;
		
	title = this.wizardDocument.selectSingleNode("/wizard/titles/" + this.language);

	if (title == null)
	{
		title = this.wizardDocument.selectSingleNode("/wizard/title");
	}
	
	if (title != null)
	{
		document.title = title.text;
	}
	
	finishAction = this.wizardDocument.selectSingleNode("/wizard/finishActionLabels/" + this.language);

	if (finishAction == null)
	{
		finishAction = this.wizardDocument.selectSingleNode("/wizard/finishActionLabel");
	}
	
	if (finishAction == null)
	{
		finishAction = this.wizardDocument.selectSingleNode("/wizard/titles/" + this.language);

		if (finishAction == null)
		{
			finishAction = this.wizardDocument.selectSingleNode("/wizard/title");
		}
	}
	
	if (finishAction != null)
	{
		document.all["finishButton"].value = finishAction.text;
	}
	
	
	finishAction = this.wizardDocument.selectSingleNode("/wizard/finishAction2Labels/" + this.language);

	if (finishAction == null)
	{
		finishAction = this.wizardDocument.selectSingleNode("/wizard/finishAction2Label");
	}
	
	if (finishAction != null)
	{
		document.all["finishButton2"].value = finishAction.text;
		this.bFinish2 = true;
	}
	
	finishAction = this.wizardDocument.selectSingleNode("/wizard/finishAction3Labels/" + this.language);

	if (finishAction == null)
	{
		finishAction = this.wizardDocument.selectSingleNode("/wizard/finishAction3Label");
	}
	
	if (finishAction != null)
	{
		document.all["finishButton3"].value = finishAction.text;
		this.bFinish3 = true;
	}
	
	this.contextDocument = new ActiveXObject("Msxml2.DOMDocument");
	
	contextNode = this.contextDocument.createElement("context");
	
	this.contextDocument.documentElement = contextNode;
	
	return true;
}

Wizard.prototype.AddParameters = function (parameters)
{
	var param;
	var elem;
	
	if (parameters != null)
	{
		for(var i = 0; i < parameters.length; i++)
		{
			param = parameters[i];
			
			elem = this.contextDocument.documentElement.selectSingleNode(param.name);
			
			if (elem != null)
			{
				elem.text = param.value;
			}
			else
			{
				elem = this.contextDocument.createElement(param.name);
				
				elem.text = param.value;
				
				this.contextDocument.documentElement.appendChild(elem);
			}
		}
	}
}

Wizard.prototype.ShowSteps = function ()
{
	var label;
	var htmlSteps;
	var className;
	var imgName;

	if (this.steps == null)
	{
		this.steps = this.wizardDocument.selectNodes("/wizard/steps/step");
	}
	
	if (this.steps.length > 0)
	{
		htmlSteps = '<table class="tableLeft" cellpadding="0" cellspacing="0" width="100%" height="100%">';
		htmlSteps += '<tr><td width="100%" height="1" valign="top">';
		htmlSteps += '<table cellpadding="0" cellspacing="0" width="100%" valign="top">';
		htmlSteps += '<tr><td height="18" align="left" colspan="3"><img src="Images/CMPath_ArrowTop.gif" width="24" height="18"></td></tr>';
		
		for(var i = 0; i < this.steps.length; i++)
		{
			label = this.steps(i).selectSingleNode('labels/' + this.language);
			if (label == null)
			{
				label = this.steps(i).selectSingleNode('label');
			}

			if (i < this.currentStep)
			{
				imgName = 'CMPath_GreenSquare';
				className = 'previousStep';
			}
			else
			{
				if (i == this.currentStep)
				{
					imgName = 'CMPath_BlueSquare';
					className = 'currentStep';
				}
				else
				{
					imgName = 'CMPath_YellowSquare';
					className = 'nextStep';
				}
			}
			
			htmlSteps += '<tr><td><img src="Images/' + imgName + '.gif" width="24" height="18"></td><td class="' + className + '"';
			
			if (i == this.currentStep)
			{
				htmlSteps += ' background="Images/CMPath_BGCurrentStep.gif"';
			}
			
			htmlSteps += '><nobr>';

			htmlSteps += label.text;
			
			htmlSteps += '</nobr></td><td width="100%">';
			
			if (i == this.currentStep)
			{
				htmlSteps += '<img src="Images/CMPath_RightStepOver.gif" width="8" height="18">';
			}
			
			htmlSteps += '</td></tr>';			
		}

		htmlSteps += '<tr><td colspan="3"><table cellpadding="0" cellspacing="0" width="100%" height="100%" valign="top"><tr><td width="40"><img src="Images/CMPath_End.gif" width="40" height="18"></td><td align="left" class="nextStep">&nbsp;</td></tr></table></td></tr>';
		htmlSteps += '</table>';
		htmlSteps += '</td></tr>';
		htmlSteps += '</table>';
		
		if (this.currentStep == 0 || this.currentStep == this.steps.length)
		{
			document.all["cellPrevious"].style.display = 'none';
		}
		else
		{
			document.all["cellPrevious"].style.display = '';
		}
		
		if (this.currentStep >= this.steps.length -1)
		{
			document.all["cellNext"].style.display = 'none';
		}
		else
		{
			document.all["cellNext"].style.display = '';
		}
		
		if (this.currentStep == this.steps.length -1)
		{
			document.all["cellFinish"].style.display = '';
		}
		else
		{
			document.all["cellFinish"].style.display = 'none';
		}
		
		if (this.bFinish2)
		{
			if (this.currentStep == this.steps.length -1)
			{
				document.all["cellFinish2"].style.display = '';
			}
			else
			{
				document.all["cellFinish2"].style.display = 'none';
			}
		}
		else
		{
			document.all["cellFinish2"].style.display = 'none';
		}
		
		if (this.bFinish3)
		{
			if (this.currentStep == this.steps.length -1)
			{
				document.all["cellFinish3"].style.display = '';
			}
			else
			{
				document.all["cellFinish3"].style.display = 'none';
			}
		}
		else
		{
			document.all["cellFinish3"].style.display = 'none';
		}
		
		document.all["WizardPath"].innerHTML = htmlSteps;
	}
}

Wizard.prototype.GetRows = function(dataSource)
{
	var serviceName;
	var functionName;
	var status;
	var doc;
	var post;
	var response;
	var responseDocument;

	serviceName = dataSource.selectSingleNode("serviceName");
	functionName = dataSource.selectSingleNode("functionName");

	if (serviceName != null && functionName != null)
	{
		post = "context=" + encodeURIComponent(this.contextDocument.xml);

		if (serviceName.text.charAt(0) == '/')
		{
			this.xmlHttp.Open("POST", serviceName.text + '/' + functionName.text, false);
		}
		else
		{
			this.xmlHttp.Open("POST", this.baseUrl + serviceName.text + '/' + functionName.text, false);
		}
		this.xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
		this.xmlHttp.Send(post);

		doc = this.xmlHttp.responseXML;

		if (doc.parseError.errorCode != 0 || doc.xml == '')
		{
			//alert(this.xmlHttp.responseText);
			document.all["WizardContent"].innerHTML = 'unable to execute request';
		}
		else
		{
			response = doc.documentElement.firstChild.text;
			responseDocument = new ActiveXObject("Msxml2.DOMDocument");
			
			responseDocument.loadXML(response);
			
			if (responseDocument.parseError.errorCode != 0 || responseDocument.xml == '')
			{
				//alert(responseDocument.parseError.reason);
				document.all["WizardContent"].innerHTML = 'unable to retrieve read response';
			}
			else
			{
				status = responseDocument.documentElement.firstChild;

				if (status.text == 'succeed')
				{
					return status.nextSibling;
				}
				else
				{
					return null;
				}
			}
		}
	}
	else
	{
		return null;
	}
}

Wizard.prototype.ShowFields = function()
{
	var dataSource;
	var rows;
	var children;
	var row;
	var element;
	var html;
	var fields;
	var field;
	var node;
	
	this.currentFields = new Array();

	rows = this.steps(this.currentStep).selectSingleNode('rows');
	if (rows == null)
	{
		dataSource = this.steps(this.currentStep).selectSingleNode('dataSource');
		
		if (dataSource == null)
		{
			return;
		}

		rows = this.GetRows(dataSource);

		if (rows == null)
		{
			return;
		}
	}

	children = rows.childNodes;
	
	
	html = '<table border="0" cellpadding="0" cellspacing="0" width="100%">';
		
	for(var i = 0; i < children.length; i++)
	{
		row = children(i);
		
		switch(row.tagName)
		{
			case 'row':
				element = row.firstChild;
								
				switch(element.nodeName)
				{
					case 'title':
						node = row.selectSingleNode('titles/' + this.language);
						if (node == null)
						{
							html += '<tr><td class="title" colspan="3">' + element.text + '</td></tr>';
						}
						else
						{
							html += '<tr><td class="title" colspan="3">' + node.text + '</td></tr>';
						}
						break;
					case 'info':
						html += '<tr><td></td><td class="label"><nobr>' + element.firstChild.text + '&nbsp;:&nbsp;</nobr></td><td class="text" width="100%">' + element.lastChild.text + '</td></tr>';
						break;
					case 'field':
						html += this.GenerateFieldHtml(element);
						break;
				}
				break;
			case 'spacer':
				html += '<tr><td colspan="3" height="8"><img src="Images/transp.gif" width="100%" height="8px;"/></td></tr>';
				break;
			case 'separator':
				html += '<tr><td colspan="3" height="4"><img src="Images/transp.gif" width="100%" height="4px;"/></td></tr>';
				html += '<tr><td class="separator" colspan="3"><img src="Images/transp.gif" width="100%" height="1px;"/></td></tr>';
				html += '<tr><td colspan="3" height="8"><img src="Images/transp.gif" width="100%" height="8px;"/></td></tr>';
				break;
		}
	}
	
	html += '</table>';
	//alert(html);
	document.all["WizardContent"].innerHTML = html;
}

Wizard.prototype.GenerateFieldHtml = function(fieldNode)
{
	var fieldName;
	var fieldLabel;
	var fieldType;
	var fieldMandatory;
	var fieldAllowedCaracters;
	var fieldDefault;
	var fieldClass;
	var fieldChecked;
	var fieldRows;
	var children;
	var child;
	var html;
	var items;
	var item;
	var itemText;
	var itemValue;
	var contextElement;
	var bValueSet;
	var node;
	var pageSelectorLabel;
	var pageSelectorValue;
	var pageSelectorValueLabel;
	var pageSelectorInitialPosition;
	var pageSelectorDisableNode;
	var mode;
	var websites;
	var website;
	var websiteName;
	var nodes;
	var nodeId;
	var nodeName;
	var actions;
	var action;
	var actionId;
	var actionDate;
	var actionType;
	var wc;
	var bAlternate;
	var currentactions;
	
	children = fieldNode.childNodes;
	fieldName = null;
	fieldLabel = null;
	fieldType = null;
	fieldMandatory = 'false';
	fieldAllowedCaracters = null;
	fieldMaxCaracters = null;
	fieldDefault = null;
	fieldClass = null;
	fieldChecked = null;
	fieldRows = null;
	
	html = '';
	//alert(children.length);
	for(var i = 0; i < children.length; i++)
	{
		child = children(i);
		
		switch(child.nodeName)
		{
			case 'name':
				fieldName = child.text;
				break;
			case 'label':
				node = fieldNode.selectSingleNode('labels/' + this.language);
				if (node == null)
				{
					fieldLabel = child.text;
				}
				else
				{
					fieldLabel = node.text;
				}
				break;
			case 'type':
				fieldType = child.text;
				break;
			case 'mandatory':
				fieldMandatory = child.text;
				break;
			case 'class':
				fieldClass = child.text;
				break;
			case 'default':
				fieldDefault = child.text;
				break;
			case 'checked':
				fieldChecked = child.text;
				break;
			case 'rows':
				fieldRows = child.text;
				break;
			case 'allowedCaracters':
				fieldAllowedCaracters = child.text;
				break;
			case 'maxCaracters':
				fieldMaxCaracters = child.text;
				break;
		}
	}

	if (fieldName != null && fieldType != null)
	{
		html = '<tr>';
		
		if (fieldMandatory == 'true')
		{
			html += '<td class="mandatory">(*)&nbsp;</td>';
		}
		else
		{
			html += '<td class="mandatory"></td>';
		}

		html += '<td class="label" nowrap>';
		
		if (fieldLabel != null)
		{
			html += fieldLabel + ' :&nbsp;';
		}
		
		html += '</td><td width="100%">';
		
		contextElement = this.contextDocument.documentElement.selectSingleNode(fieldName);

		//alert(fieldType);
		switch(fieldType)
		{
			case 'dropdown':
				html += '<select id="' + fieldName + '"';
				
				if (fieldClass != null)
				{
					html += 'class="' + fieldClass + '"';
				}
				
				html += '>';

				items = fieldNode.selectNodes('items/item');
				
				for(var idx = 0; idx < items.length; idx++)
				{
					item = items(idx);
				
					children = item.childNodes;

					itemText = '';
					itemValue = '';
					
					for(var i = 0; i < children.length; i++)
					{
						child = children(i);
						
						switch(child.nodeName)
						{
							case 'text':
								itemText = child.text;
								break;
							case 'value':
								itemValue = child.text;
								break;
						}
					}

					html += '<option value="' + itemValue + '"';
					
					if (contextElement != null)
					{
						if (itemValue == contextElement.text)
						{
							html += ' SELECTED';
						}
					}
					else
					{
						if (itemValue == fieldDefault)
						{
							html += ' SELECTED';
						}
					}
					
					html += '>' + itemText + '</option>';
				}

				html += '</select>';

				this.currentFields[this.currentFields.length] = new Field(fieldName, 'dropdown', fieldMandatory == 'true');

				break;
			case 'radio':
				html += '<table';
				if (fieldClass != null)
				{
					html += ' class="' + fieldClass + '"';
				}
				html += '>';
				
				items = fieldNode.selectNodes('items/item');
				
				for(var idx = 0; idx < items.length; idx++)
				{
					html += '<tr><td';
					if (fieldClass != null)
					{
						html += ' class="' + fieldClass + '"';
					}
					html += '>';
					item = items(idx);
				
					children = item.childNodes;

					itemText = '';
					itemValue = '';
					
					for(var i = 0; i < children.length; i++)
					{
						child = children(i);
						
						switch(child.nodeName)
						{
							case 'text':
								itemText = child.text;
								break;
							case 'value':
								itemValue = child.text;
								break;
						}
					}

					html += '<INPUT id="' + fieldName + '" type="radio" value="' + itemValue + '" name="' + fieldName + '_Group" ';
				
					if (fieldClass != null)
					{
						html += 'class="' + fieldClass + '"';
					}
					
					if (contextElement != null)
					{
						if (itemValue == contextElement.text)
						{
							html += ' CHECKED';
						}
					}
					else
					{
						if (itemValue == fieldDefault)
						{
							html += ' CHECKED';
						}
					}
					
					html += '>' + itemText + '</INPUT>';
					html += '</td></tr>';
				}
				html += '</table>';

				this.currentFields[this.currentFields.length] = new Field(fieldName, 'radio', false);

				break;
			case 'checkbox':
				html += '<input type="checkbox" id="' + fieldName + '"';
				
				if (fieldClass != null)
				{
					html += 'class="' + fieldClass + '"';
				}
				if (fieldChecked != null)
				{
					if (fieldChecked == "true")
					{
						html += ' CHECKED ';
					}
				}
				
				html += '/>';

				this.currentFields[this.currentFields.length] = new Field(fieldName, 'checkbox', false);

				break;
			case 'text':
				html += '<input id="' + fieldName + '" type="text"';
				
				if (fieldMaxCaracters != null)
				{
					html += ' maxLength="' + fieldMaxCaracters + '"';
				}
				
				if (fieldClass != null)
				{
					html += ' class="' + fieldClass + '"';
				}
				
				bValueSet = false;
				if (contextElement != null)
				{
					html += ' value="' + contextElement.text + '"';
					bValueSet = true;
				}
				else
				{
					if (fieldDefault != null)
					{
						html += ' value="' + fieldDefault + '"';
						bValueSet = true;
					}
				}

				if (fieldMandatory == 'true')
				{
					html += ' onkeyup="CheckChanges()" onchange="CheckChanges()"';
				}

				if (fieldAllowedCaracters != null)
				{
					html += ' allowedCaracters="' + fieldAllowedCaracters + '"';
				}
				
				if (fieldMaxCaracters != null)
				{
					html += ' maxCaracters="' + fieldMaxCaracters + '"';
				}
				
				if (fieldAllowedCaracters != null || fieldMaxCaracters != null)
				{
					html += ' onkeypress="ValidateCaracters()"';// onbeforepaste="BeforePaste()" onpaste="CheckPaste()"';
				}

				html += '>';
				
				//alert(html);

				this.currentFields[this.currentFields.length] = new Field(fieldName, 'text', fieldMandatory == 'true');
				break;
			case 'textarea':
				html += '<textarea id="' + fieldName + '" ';
				
				if (fieldClass != null)
				{
					html += ' class="' + fieldClass + '"';
				}
				
				if (fieldRows != null)
				{
					html += ' rows="' + fieldRows + '"';
				}
				
				bValueSet = false;
				
				if (fieldMandatory == 'true')
				{
					html += ' onkeyup="CheckChanges()" onchange="CheckChanges()"';
				}

				if (fieldAllowedCaracters != null)
				{
					html += ' allowedCaracters="' + fieldAllowedCaracters + '"';
				}
				
				if (fieldMaxCaracters != null)
				{
					html += ' maxCaracters="' + fieldMaxCaracters + '"';
				}
				
				if (fieldAllowedCaracters != null || fieldMaxCaracters != null)
				{
					html += ' onkeypress="ValidateCaracters()"';
				}

				html += '>';
				
				if (contextElement != null)
				{
					html += contextElement.text;
					bValueSet = true;
				}
				else
				{
					if (fieldDefault != null)
					{
						html += fieldDefault;
						bValueSet = true;
					}
				}

				html += '</textarea>';
				
				this.currentFields[this.currentFields.length] = new Field(fieldName, 'text', fieldMandatory == 'true');
				break;
			case 'hidden':
				html += '<input id="' + fieldName + '" type="hidden"';

				bValueSet = false;
				if (contextElement != null)
				{
					html += ' value="' + contextElement.text + '"';
					bValueSet = true;
				}
				else
				{
					if (fieldDefault != null)
					{
						html += ' value="' + fieldDefault + '"';
						bValueSet = true;
					}
				}

				html += '>';

				this.currentFields[this.currentFields.length] = new Field(fieldName, 'hidden', fieldMandatory == 'true');
				break;
			case 'pageselector':
				html += '<input id="' + fieldName + '" type="hidden"';

				pageSelectorInitialPosition = fieldNode.selectSingleNode("initialPosition");

				if (pageSelectorInitialPosition != null)
				{
					html += ' initialPosition="' + pageSelectorInitialPosition.text + '"';
				}
				else
				{
					html += ' initialPosition=""';
				}
				
				pageSelectorDisableNode = fieldNode.selectSingleNode("disableNode");

				if (pageSelectorDisableNode != null)
				{
					html += ' disableNode="' + pageSelectorDisableNode.text + '"';
				}
				else
				{
					html += ' disableNode=""';
				}

				bValueSet = false;
				pageSelectorValue = null;
				if (contextElement != null)
				{
					html += ' value="' + contextElement.text + '"';
					pageSelectorValue = contextElement.text;
					bValueSet = true;
				}
				else
				{
					if (fieldDefault != null)
					{
						html += ' value="' + fieldDefault + '"';
						pageSelectorValue = fieldDefault;
						bValueSet = true;
					}
				}

				html += '>';
				
				//alert(html);

				html += '<span id="lbl_' + fieldName + '">';
				if (bValueSet)
				{
					html += this.GetPageTitle(pageSelectorValue);
				}
				html += '</span>';
				
				html += '<input id="btn_' + fieldName + '" type="button" value="';
				
				pageSelectorLabel = this.wizardDocument.selectSingleNode("/wizard/pageSelector/button/labels/" + this.language);

				if (pageSelectorLabel == null)
				{
					pageSelectorLabel = this.wizardDocument.selectSingleNode("/wizard/pageSelector/button/label");
				}
				
				if (pageSelectorLabel != null)
				{
					html += pageSelectorLabel.text;
				}
				else
				{
					html += "Browse";
				}
				
				html += '" onclick="ShowPageSelector();">';

				this.currentFields[this.currentFields.length] = new Field(fieldName, 'pageselector', fieldMandatory == 'true');
				break;
			case 'actionsselector':
				html += '<input id="' + fieldName + '" type="hidden"';
				currentactions = null;
				if (contextElement != null)
				{
					html += ' value="' + contextElement.text + '"';
					currentactions = contextElement.text.split(';');
				}
				else
				{
					if (fieldDefault != null)
					{
						html += ' value="' + fieldDefault + '"';
						currentactions = fieldDefault.split(';');
					}
				}

				html += '>';
				
				node = fieldNode.selectSingleNode('mode');
				
				if (node != null)
				{
					mode = node.text;
				}
				else
				{
					mode ='submit';
				}

				websites = fieldNode.selectNodes('actions/website');
				
				wc = document.all["WizardContent"];
				
				html += '<div id="actionsDiv" style="text-overflow:ellipsis;overflow:scroll;width:' + (wc.offsetWidth - 30) + 'px;height:' + (wc.offsetHeight - 40) + 'px;">';
				//alert(websites.length);
				for(var idx = 0; idx < websites.length; idx++)
				{
					website = websites(idx);
					
					websiteId = website.selectSingleNode('id');
					websiteName = website.selectSingleNode('name');
					
					html += '<table cellpadding="0" cellspacing="0" border="0" width="100%">';
					html += '<tr>';
					//html += '<td width="19" class="websiteTitle"><img src="Images/Tree/Rminus.gif" style="cursor:hand;" onclick="ShowAllActions(\'AllActionsTD\', this);"/></td>';
					html += '<td width="95%" class="websiteTitle">' + websiteName.text + '</td>';
					html += '<td align="right" class="websiteTitle"><input type="checkbox" websiteId="' + websiteId.text + '" id="chk_websiteActions" onclick="SelectNodeActions(\'' + fieldName + '\')"></td>';
					html += '</tr>';
					html += '<tr><td colspan="2">';
					
					nodes = website.selectNodes("node");
					
					for(var nodeIdx = 0; nodeIdx < nodes.length; nodeIdx++)
					{
						node = nodes(nodeIdx);
						
						nodeId = node.selectSingleNode('id');
						nodeName = node.selectSingleNode('name');
						nodeUrl = node.selectSingleNode('nodeUrl');
						
						//alert(node.xml);
											
						html += '<table cellpadding="0" cellspacing="0" border="0" width="100%">';
						html += '<tr height="1"><td><img src="Images/Transp.gif" width="15" height="1"></td><td width="100%"></td><td></td></tr>';
						html += '<tr>';
						html += '<td><img src="Images/Tree/Rplus.gif" style="cursor:hand;" onclick="ShowAllActions(\''+ nodeId.text +'\', this);"/></td>';
						//alert(nodeName.text + " " + nodeUrl);
						html += '<td class="nodeTitle" width="100%"';
						if(nodeUrl != undefined && nodeUrl != null)
						{
							html += ' title="'+ nodeUrl.text +'"';
						}
						html += '>' + nodeName.text + '</td>';
						//html += '<td class="nodeTitle" width="100%" title="'+ nodeUrl.text +'">' + nodeName.text + '</td>';
						html += '<td align="right" class="nodeTitle">';
						html += '<input type="checkbox" websiteId="' + websiteId.text + '" nodeId="' + nodeId.text + '" id="chk_' + nodeId.text + '" onclick="SelectNodeActions(\'' + fieldName + '\')">';
						html += '</td></tr>';
						html += '<tr id="'+ nodeId.text +'_OldActions" style="display:none"><td><img src="Images/Transp.gif" width="15" height="1"></td><td width="100%" colspan="2">';

						actions = node.selectNodes("action");

						html += '<table cellpadding="0" cellspacing="0" border="0" width="100%">';
						bAlternate = false;
						
						var cpt = 0;
						var previousAction = '';
						var nextAction = '';
						var currentContentName = '';
						var previousContentName = '';
						var currentContentLanguage = '';
						var previousContentLanguage = '';
						var previousRealType;
						var currentRealType;
						var nextContentName;
						var nextContentLanguage;
						var realContentName;
						
						for(var actionIdx = 0; actionIdx < actions.length; actionIdx++)
						{
							action = actions(actionIdx);
							
							actionId = action.selectSingleNode('id');
							actionDate = action.selectSingleNode('date');
							actionType = action.selectSingleNode('type');
							actionUser = action.selectSingleNode('user');
							actionContentName = action.selectSingleNode('info/info/contentName');
							actionContentLanguage = action.selectSingleNode('info/info/language');
							actionRealType = action.selectSingleNode('realType');
							if(actionContentName != null && actionContentLanguage != null)
							{
								//alert(action.selectSingleNode('realContentName').text);
								realContentName = action.selectSingleNode('realContentName');
								if(realContentName == null)
								{
									realContentName = actionContentName;
								}
								//alert(actionContentName.text);
								currentContentName = actionContentName.text;
								currentContentLanguage = actionContentLanguage.text;
							}
							currentRealType = actionRealType.text;
							currentAction = actionType.text;
							if (actionIdx == actions.length - 1)
							{
								nextAction = '';
							}
							else
							{
								nextAction = actions(actionIdx + 1).selectSingleNode('type').text;
								nextContentName = actions(actionIdx + 1).selectSingleNode('info/info/contentName');
								nextContentLanguage = actions(actionIdx + 1).selectSingleNode('info/info/language');
							}
															
							if (previousAction != '')
							{
								
								if (previousAction != currentAction)
								{
									html += '</td></tr>';
									if(cpt>1)
									{
										html += '</table>';
									}
									cpt = 0;
									
									bAlternate = false;
								}
								if(currentRealType == previousRealType)
								{
									//alert(currentRealType);
									if(currentRealType == 'content_Updated')
									{
										if(previousContentName != currentContentName || previousContentLanguage != currentContentLanguage)
										{
											html += '</td></tr>';
											if(cpt>1)
											{
												html += '</table>';
											}
											cpt = 0;
											
											bAlternate = false;
										}
									}
								}
							}

							if (cpt == 0)
							{
								html += '<tr>';
								
								if (nextAction == currentAction)
								{
									if(currentRealType == "content_Updated")
									{
										if(nextContentName == null || nextContentName.text != currentContentName || nextContentLanguage.text != currentContentLanguage)
										{
											html += '<td width="10"><img src="Images/Tree/Rminus.gif" /></td>';
										} 
										else
										{
											html += '<td width="10"><img src="Images/Tree/Rplus.gif" style="cursor:hand;"';
											if(actionContentName != null)
											{
												html += ' onclick="ShowAllActions(\'' + nodeId.text + '_' + currentAction + '_' + currentContentName + '_' + currentContentLanguage + '\', this);" /></td>';
											}
											else
											{
												html += ' onclick="ShowAllActions(\'' + nodeId.text + '_' + currentAction + '\', this);" /></td>';
											}
										}
									}
									else
									{
										html += '<td width="10"><img src="Images/Tree/Rplus.gif" style="cursor:hand;"';
										if(actionContentName != null)
										{
											html += ' onclick="ShowAllActions(\'' + nodeId.text + '_' + currentAction + '_' + currentContentName + '_' + currentContentLanguage + '\', this);" /></td>';
										}
										else
										{
											html += ' onclick="ShowAllActions(\'' + nodeId.text + '_' + currentAction + '\', this);" /></td>';
										}
									}
									
								}
								else
								{
									html += '<td width="10"><img src="Images/Tree/Rminus.gif" /></td>';
								}
								html += '<td class="actionDate" width="125"><div TITLE="' + actionDate.text + '">' + actionDate.text + '</div></td>';
								html += '<td><table><tr>';
								html += '<td class="actionType"><div TITLE="' + actionType.text;
								if(realContentName != undefined && realContentName != null)
								{
									html += ' : ' + realContentName.text;
								}
								html += '">';
								html += actionType.text;
								if(currentRealType == "content_Updated" && currentContentLanguage != undefined && currentContentLanguage != null)
								{
									html += ' (' + currentContentLanguage + ')';
								}
								
								html += '</div></td>';
								
								if(nextAction != currentAction)
								{
									actionContentName = null;
									actionContentLanguage = null;
									realContentName = null;
								}
								
								if (actionUser != null && mode == 'approbation')
								{
									html += '<td class="actionUser"><div TITLE="' + actionUser.text + '">' + actionUser.text + '</div></td>';
								}
								html += '</tr></table></td>';
								html += '<td align="right" class="actionChk">';
																
								html += '<input type="checkbox" websiteId="' + websiteId.text + '" nodeId="' + nodeId.text + '" actionId="' + actionId.text + '" id="chk_' + actionId.text + '" class="actionChk" actionDate="lastAction" onclick="ActionChecked(\'' + fieldName + '\')"';
								
								if (currentactions != null)
								{
									for(var curIdx = 0; curIdx < currentactions.length; curIdx++)
									{
										if (currentactions[curIdx] == nodeId.text + '!' + actionId.text)
										{
											html += " CHECKED";
											
											break;
										}
									}
								}
								
								html += '>';
								
								html += '</td></tr>';
							}
							else
							{
								if (cpt == 1)
								{
									if(actionContentName != null)
									{
										html += '<tr id="' + nodeId.text + '_' + currentAction + '_' + currentContentName + '_' + currentContentLanguage + '_OldActions" style="display:none;"><td></td><td colspan="3"><table border="0" cellpadding="0" cellspacing="0" width="100%">';	
									}
									else
									{
										html += '<tr id="' + nodeId.text + '_' + currentAction + '_OldActions" style="display:none;"><td></td><td colspan="3"><table border="0" cellpadding="0" cellspacing="0" width="100%">';	
									}
								}
								if (bAlternate)
								{
									html += '<tr class="alternate">';
								}
								else
								{						
									html += '<tr>';
								}
								if (nextAction == currentAction)
								{
									if(currentRealType == "content_Updated")
									{
										if(nextContentName == null || nextContentName.text != currentContentName || nextContentLanguage.text != currentContentLanguage)
										{
											html += '<td width="10"><img src="Images/Tree/L.gif" /></td>';
										} 
										else
										{
											html += '<td width="10"><img src="Images/Tree/T.gif" /></td>';
										}
									}
									else
									{
										html += '<td width="10"><img src="Images/Tree/T.gif" /></td>';
									}
								}
								else
								{
									html += '<td width="10"><img src="Images/Tree/L.gif" /></td>';
								}
								html += '<td class="actionDate" width="105"><div TITLE="' + actionDate.text + '">' + actionDate.text + '</div></td>';
								html += '<td><table><tr>';
								html += '<td class="actionType"><div TITLE="' + actionType.text;
								if(realContentName != undefined && realContentName != null)
								{
									html += ' : ' + realContentName.text;
								}
								html += '">';
								html += actionType.text;
								if(currentRealType == "content_Updated" && currentContentLanguage != undefined && currentContentLanguage != null)
								{
									html += ' (' + currentContentLanguage + ')';
								}
																
								html += '</div></td>';
								
								if(nextAction != currentAction)
								{
									actionContentName = null;
									actionContentLanguage = null;
									realContentName = null;
								}
								
								if (actionUser != null && mode == 'approbation')
								{
									html += '<td class="actionUser"><div TITLE="' + actionUser.text + '">' + actionUser.text + '</div></td>';
								}
								html += '</tr></table></td>';
								html += '<td align="right" class="actionChk">';
								html += '<input type="checkbox" websiteId="' + websiteId.text + '" nodeId="' + nodeId.text + '" actionId="' + actionId.text + '" id="chk_' + actionId.text + '" class="actionChk" onclick="ActionChecked(\'' + fieldName + '\')"';

								if (currentactions != null)
								{
									for(var curIdx = 0; curIdx < currentactions.length; curIdx++)
									{
										if (currentactions[curIdx] == nodeId.text + '!' + actionId.text)
										{
											html += " CHECKED";
											break;
										}
									}
								}
								
								html += '>';
								html += '</td></tr>';
								
								if(actionIdx == actions.length - 1)
								{
									html += '</td></tr></table>';
								}
							}
							cpt++;
							previousAction = currentAction;
							previousContentName = currentContentName;
							previousContentLanguage = currentContentLanguage;
							previousRealType = currentRealType;
							bAlternate = !bAlternate;
						}
						html += '</table>';
						
						html += '</td></tr>';
						html += '</table>';
					}
					
					html += '</td></tr>';
					html += '<tr><td><img src="Images/Transp.gif" width="8" height="8"></td></tr>';
					html += '</table>';
				}		
				
				html += '</div>';
				//alert(html);
				this.currentFields[this.currentFields.length] = new Field(fieldName, 'actionsselector', fieldMandatory == 'true');
				break;
			case 'actionselectorapprobation':
				//alert('actionselectorapprobation');
				html += '<input id="' + fieldName + '" type="hidden"';
				currentactions = null;
				if (contextElement != null)
				{
					html += ' value="' + contextElement.text + '"';
					currentactions = contextElement.text.split(';');
				}
				else
				{
					if (fieldDefault != null)
					{
						html += ' value="' + fieldDefault + '"';
						currentactions = fieldDefault.split(';');
					}
				}

				html += '>';
				
				node = fieldNode.selectSingleNode('mode');
				
				if (node != null)
				{
					mode = node.text;
				}
				else
				{
					mode ='submit';
				}

				websites = fieldNode.selectNodes('actions/website');
				
				wc = document.all["WizardContent"];
				
				html += '<div id="actionsDiv" style="text-overflow:ellipsis;overflow:scroll;width:' + (wc.offsetWidth - 30) + 'px;height:' + (wc.offsetHeight - 40) + 'px;">';
				//alert(websites.length);
				for(var idx = 0; idx < websites.length; idx++)
				{
					website = websites(idx);
					
					websiteId = website.selectSingleNode('id');
					websiteName = website.selectSingleNode('name');
					
					html += '<table cellpadding="0" cellspacing="0" border="0" width="100%">';
					html += '<tr>';
					//html += '<td width="19" class="websiteTitle"><img src="Images/Tree/Rminus.gif" style="cursor:hand;" onclick="ShowAllActions(\'AllActionsTD\', this);"/></td>';
					html += '<td width="95%" class="websiteTitle">' + websiteName.text + '</td>';
					html += '<td align="right" class="websiteTitle"><input type="checkbox" websiteId="' + websiteId.text + '" id="chk_websiteActions" onclick="SelectNodeActions(\'' + fieldName + '\')"></td>';
					html += '</tr>';
					html += '<tr><td colspan="2">';
					
					nodes = website.selectNodes("node");
					
					for(var nodeIdx = 0; nodeIdx < nodes.length; nodeIdx++)
					{
						node = nodes(nodeIdx);
						
						nodeId = node.selectSingleNode('id');
						nodeName = node.selectSingleNode('name');
						nodeUrl = node.selectSingleNode('nodeUrl');
											
						html += '<table cellpadding="0" cellspacing="0" border="0" width="100%">';
						html += '<tr height="1"><td><img src="Images/Transp.gif" width="15" height="1"></td><td width="100%"></td><td></td></tr>';
						html += '<tr>';
						html += '<td><img src="Images/Tree/Rplus.gif" style="cursor:hand;" onclick="ShowAllActions(\''+ nodeId.text +'\', this);"/></td>';
						html += '<td class="nodeTitle" width="100%"';
						if(nodeUrl != undefined && nodeUrl != null)
						{
							html += ' title="'+ nodeUrl.text +'"';
						}
						html += '>' + nodeName.text + '</td>';
						//html += '<td class="nodeTitle" width="100%" title="'+ nodeUrl.text +'">' + nodeName.text + '</td>';
						html += '<td align="right" class="nodeTitle">';
						html += '<input type="checkbox" websiteId="' + websiteId.text + '" nodeId="' + nodeId.text + '" id="chk_' + nodeId.text + '" onclick="SelectNodeActions(\'' + fieldName + '\')">';
						html += '</td></tr>';
						html += '<tr id="'+ nodeId.text +'_OldActions" style="display:none"><td><img src="Images/Transp.gif" width="15" height="1"></td><td width="100%" colspan="2">';

						actions = node.selectNodes("action");

						html += '<table cellpadding="0" cellspacing="0" border="0" width="100%">';
						bAlternate = false;
						
						var cpt = 0;
						var previousAction = '';
						var nextAction = '';
						var currentContentName = '';
						var previousContentName = '';
						var previousContentLanguage = '';
						var currentContentLanguage = '';
						var previousRealType;
						var currentRealType;
						var nextContentName;
						var realContentName;
						
						for(var actionIdx = 0; actionIdx < actions.length; actionIdx++)
						{
							action = actions(actionIdx);
							
							actionId = action.selectSingleNode('id');
							actionDate = action.selectSingleNode('date');
							actionType = action.selectSingleNode('type');
							actionUser = action.selectSingleNode('user');
							actionContentName = action.selectSingleNode('info/info/contentName');
							actionContentLanguage = action.selectSingleNode('info/info/language');
							actionRealType = action.selectSingleNode('realType');
							if(actionContentName != null)
							{
								//alert(action.selectSingleNode('realContentName').text);
								realContentName = action.selectSingleNode('realContentName');
								if(realContentName == null)
								{
									realContentName = actionContentName;
								}
								//alert(actionContentName.text);
								currentContentName = actionContentName.text;
								currentContentLanguage = actionContentLanguage.text;
							}
							currentRealType = actionRealType.text;
							currentAction = actionType.text;
							if (actionIdx == actions.length - 1)
							{
								nextAction = '';
							}
							else
							{
								nextAction = actions(actionIdx + 1).selectSingleNode('type').text;
								nextContentName = actions(actionIdx + 1).selectSingleNode('info/info/contentName');
								nextContentLanguage = actions(actionIdx + 1).selectSingleNode('info/info/language');
							}
															
							if (previousAction != '')
							{
								
								if (previousAction != currentAction)
								{
									html += '</td></tr>';
									if(cpt>1)
									{
										html += '</table>';
									}
									cpt = 0;
									
									bAlternate = false;
								}
								if(currentRealType == previousRealType)
								{
									//alert(currentRealType);
									if(currentRealType == 'content_Updated')
									{
									//alert(previousContentName + " " + currentContentName);
										if(previousContentName != currentContentName || previousContentLanguage != currentContentLanguage)
										{
											html += '</td></tr>';
											if(cpt>1)
											{
												html += '</table>';
											}
											cpt = 0;
											
											bAlternate = false;
										}
									}
								}
							}

							if (cpt == 0)
							{
								html += '<tr>';
								
								if (nextAction == currentAction)
								{
									if(currentRealType == "content_Updated")
									{
										if(nextContentName == null || nextContentName.text != currentContentName || nextContentLanguage.text != currentContentLanguage)
										{
											html += '<td width="10"><img src="Images/Tree/Rminus.gif" /></td>';
										} 
										else
										{
											html += '<td width="10"><img src="Images/Tree/Rplus.gif" style="cursor:hand;"';
											if(actionContentName != null)
											{
												html += ' onclick="ShowAllActions(\'' + nodeId.text + '_' + currentAction + '_' + currentContentName + '_' + currentContentLanguage + '\', this);" /></td>';
											}
											else
											{
												html += ' onclick="ShowAllActions(\'' + nodeId.text + '_' + currentAction + '\', this);" /></td>';
											}
										}
									}
									else
									{
										html += '<td width="10"><img src="Images/Tree/Rplus.gif" style="cursor:hand;"';
										if(actionContentName != null)
										{
											html += ' onclick="ShowAllActions(\'' + nodeId.text + '_' + currentAction + '_' + currentContentName + '_' + currentContentLanguage + '\', this);" /></td>';
										}
										else
										{
											html += ' onclick="ShowAllActions(\'' + nodeId.text + '_' + currentAction + '\', this);" /></td>';
										}
									}
									
								}
								else
								{
									html += '<td width="10"><img src="Images/Tree/Rminus.gif" /></td>';
								}
								html += '<td class="actionDate" width="75"><div TITLE="' + actionDate.text + '">' + actionDate.text + '</div></td>';
								html += '<td><table cellpadding="0" cellspacing="0" border="0"><tr>';
								html += '<td class="actionType"><div TITLE="' + actionType.text;
								if(realContentName != undefined && realContentName != null)
								{
									html += ' : ' + realContentName.text;
								}
								html += '">';
								html += actionType.text;
								if(currentRealType == "content_Updated" && currentContentLanguage != undefined && currentContentLanguage != null)
								{
									html += ' (' + currentContentLanguage + ')';
								}
																
								html += '</div></td>';
								
								if(nextAction != currentAction)
								{
									actionContentName = null;
									realContentName = null;
								}
								
								if (actionUser != null && mode == 'approbation')
								{
									html += '<td class="actionUser"><div TITLE="' + actionUser.text + '">' + actionUser.text + '</div></td>';
								}
								html += '<td class="actionInfo" onmouseover="this.className=\'actionInfoOver\';" onmouseout="this.className=\'actionInfo\';" onclick="ShowActionInfo(\'' + actionId.text + '\', \'' + this.baseUrl + '\', \'' + this.applicationPath + '\')"><div TITLE="">Info</div></td>';
								html += '</tr></table></td>';
								html += '<td align="right" class="actionChk">';
																
								html += '<input type="checkbox" websiteId="' + websiteId.text + '" nodeId="' + nodeId.text + '" actionId="' + actionId.text + '" id="chk_' + actionId.text + '" class="actionChk" actionDate="lastAction" onclick="ActionChecked(\'' + fieldName + '\')"';
								
								if (currentactions != null)
								{
									for(var curIdx = 0; curIdx < currentactions.length; curIdx++)
									{
										if (currentactions[curIdx] == nodeId.text + '!' + actionId.text)
										{
											html += " CHECKED";
											
											break;
										}
									}
								}
								
								html += '>';
								
								html += '</td></tr>';
							}
							else
							{
								if (cpt == 1)
								{
									if(actionContentName != null)
									{
										html += '<tr id="' + nodeId.text + '_' + currentAction + '_' + currentContentName + '_' + currentContentLanguage + '_OldActions" style="display:none;"><td></td><td colspan="3"><table border="0" cellpadding="0" cellspacing="0" width="100%">';	
									}
									else
									{
										html += '<tr id="' + nodeId.text + '_' + currentAction + '_OldActions" style="display:none;"><td></td><td colspan="3"><table border="0" cellpadding="0" cellspacing="0" width="100%">';	
									}
								}
								if (bAlternate)
								{
									html += '<tr class="alternate">';
								}
								else
								{						
									html += '<tr>';
								}
								if (nextAction == currentAction)
								{
									if(currentRealType == "content_Updated")
									{
										if(nextContentName == null || nextContentName.text != currentContentName  || nextContentLanguage.text != currentContentLanguage)
										{
											html += '<td width="10"><img src="Images/Tree/L.gif" /></td>';
										} 
										else
										{
											html += '<td width="10"><img src="Images/Tree/T.gif" /></td>';
										}
									}
									else
									{
										html += '<td width="10"><img src="Images/Tree/T.gif" /></td>';
									}
								}
								else
								{
									html += '<td width="10"><img src="Images/Tree/L.gif" /></td>';
								}
								html += '<td class="actionDateNiv1" width="75"><div TITLE="' + actionDate.text + '">' + actionDate.text + '</div></td>';
								html += '<td><table cellpadding="0" cellspacing="0" border="0"><tr>';
								html += '<td class="actionType"><div TITLE="' + actionType.text;
								if(realContentName != undefined && realContentName != null)
								{
									html += ' : ' + realContentName.text;
								}
								html += '">';
								html += actionType.text;
								if(currentRealType == "content_Updated" && currentContentLanguage != undefined && currentContentLanguage != null)
								{
									html += ' (' + currentContentLanguage + ')';
								}
																
								html += '</div></td>';
								
								if(nextAction != currentAction)
								{
									actionContentName = null;
									realContentName = null;
								}
								
								if (actionUser != null && mode == 'approbation')
								{
									html += '<td class="actionUser"><div TITLE="' + actionUser.text + '">' + actionUser.text + '</div></td>';
								}
								html += '<td class="actionInfo" onmouseover="this.className=\'actionInfoOver\';" onmouseout="this.className=\'actionInfo\';" onclick="ShowActionInfo(\'' + actionId.text + '\', \'' + this.baseUrl + '\', \'' + this.applicationPath + '\')"><div TITLE="">Info</div></td>';
								html += '</tr></table></td>';
								html += '<td align="right" class="actionChk">';
								html += '<input type="checkbox" websiteId="' + websiteId.text + '" nodeId="' + nodeId.text + '" actionId="' + actionId.text + '" id="chk_' + actionId.text + '" class="actionChk" onclick="ActionChecked(\'' + fieldName + '\')"';

								if (currentactions != null)
								{
									for(var curIdx = 0; curIdx < currentactions.length; curIdx++)
									{
										if (currentactions[curIdx] == nodeId.text + '!' + actionId.text)
										{
											html += " CHECKED";
											break;
										}
									}
								}
								
								html += '>';
								html += '</td></tr>';
								
								if(actionIdx == actions.length - 1)
								{
									html += '</td></tr></table>';
								}
							}
							cpt++;
							previousAction = currentAction;
							previousContentName = currentContentName;
							previousContentLanguage = currentContentLanguage;
							previousRealType = currentRealType;
							bAlternate = !bAlternate;
						}
						html += '</table>';
						
						html += '</td></tr>';
						html += '</table>';
					}
					
					html += '</td></tr>';
					html += '<tr><td><img src="Images/Transp.gif" width="8" height="8"></td></tr>';
					html += '</table>';
				}		
				
				html += '</div>';
				//alert(html);
				this.currentFields[this.currentFields.length] = new Field(fieldName, 'actionsselector', fieldMandatory == 'true');
				break;
			case 'actionviewer':
				//alert("actionviewer");
				//alert(this.baseUrl);
				wc = document.all["WizardContent"];
				
				html += '<div id="actionsDiv" style="text-overflow:ellipsis;overflow:scroll;width:' + (wc.offsetWidth - 30) + 'px;height:' + (wc.offsetHeight - 40) + 'px;">';
				
				html += '<table cellpadding="0" cellspacing="0" border="0" width="100%">';
				html += '<tr><td colspan="2">';
				//alert(fieldNode.xml);
				nodes = fieldNode.selectNodes("node");
				//alert(nodes.length);
				for(var nodeIdx = 0; nodeIdx < nodes.length; nodeIdx++)
				{
					node = nodes(nodeIdx);
					//alert(node.xml);
					nodeId = node.selectSingleNode('id');
					nodeName = node.selectSingleNode('name');
					
					html += '<table cellpadding="0" cellspacing="0" border="0" width="100%">';
					html += '<tr height="1"><td><img src="Images/Transp.gif" width="15" height="1"></td><td width="100%"></td><td></td></tr>';
					html += '<tr>';
					html += '<td><img src="Images/Tree/Rplus.gif" style="cursor:hand;" onclick="ShowAllActions(\''+ nodeId.text +'\', this);"/></td>';
					
					html += '<td class="nodeTitle" width="100%">' + nodeName.text + '</td>';
					html += '</tr>';
					html += '<tr id="'+ nodeId.text +'_OldActions" style="display:none"><td><img src="Images/Transp.gif" width="15" height="1"></td><td width="100%" colspan="2">';

					actions = node.selectNodes("action");

					html += '<table cellpadding="0" cellspacing="0" border="0" width="100%">';
					bAlternate = false;
					
					var cpt = 0;
					var previousAction = '';
					var nextAction = '';
					//alert(actions.length);
					for(var actionIdx = 0; actionIdx < actions.length; actionIdx++)
					{
						action = actions(actionIdx);
						
						actionId = action.selectSingleNode('id');
						actionDate = action.selectSingleNode('date');
						actionType = action.selectSingleNode('type');
						actionInfo = action.selectSingleNode('actionInfo');
						//actionUser = action.selectSingleNode('user');
						actionRealType = action.selectSingleNode('realType');
						actionRedirectUrl = action.selectSingleNode('redirectUrl');
						
						currentAction = actionType.text;
						if (actionIdx == actions.length - 1)
						{
							nextAction = '';
						}
						else
						{
							nextAction = actions(actionIdx + 1).selectSingleNode('type').text;
						}
														
						if (previousAction != '')
						{
							
							if (previousAction != currentAction)
							{
								html += '</td></tr>';
								if(cpt>1)
								{
									html += '</table>';
								}
								cpt = 0;
								
								bAlternate = false;
							}
						}

						if (cpt == 0)
						{
							html += '<tr>';
							
							if (nextAction == currentAction)
							{
								html += '<td width="10"><img src="Images/Tree/Rplus.gif" style="cursor:hand;" onclick="ShowAllActions(\'' + nodeId.text + '_' + currentAction + '\', this);" /></td>';
							}
							else
							{
								html += '<td width="10"><img src="Images/Tree/Rminus.gif" /></td>';
							}
							html += '<td class="actionDate" width="125"><div TITLE="' + actionDate.text + '">' + actionDate.text + '</div></td>';
							html += '<td><table cellpadding="0" cellspacing="0" border="0" width="100%"><tr>';
							html += '<td width="100%" class="actionViewerType"><div TITLE="' + actionType.text + '">' + actionType.text + '</div></td>';
							if(actionRealType != undefined && actionRealType != null)
							{
								switch(actionRealType.text)
								{
									case "node_created":
									case "node_propertiesupdated":
									case "node_moved":
									case "node_renamed":
									case "node_offline":
									case "node_online":
										html += '<td class="actionInfo" onmouseover="this.className=\'actionInfoOver\';" onmouseout="this.className=\'actionInfo\';" onclick="ShowActionInfo(\'' + actionId.text + '\', \'' + this.baseUrl + '\', \'' + this.applicationPath + '\')"><div TITLE="">Info</div></td>';
										break;
									case "content_updated":
										//alert(actionRedirectUrl.text);
										if(actionRedirectUrl != undefined && actionRedirectUrl != null && actionRedirectUrl.text != "")
										{
											html += '<td class="actionInfo" onmouseover="this.className=\'actionInfoOver\';" onmouseout="this.className=\'actionInfo\';" onclick="window.open(\'' + actionRedirectUrl.text + '\')"><div TITLE="">Info</div></td>';
										}
										else
										{
											html += '<td class="actionInfo" onmouseover="this.className=\'actionInfoOver\';" onmouseout="this.className=\'actionInfo\';" onclick="ShowActionInfo(\'' + actionId.text + '\', \'' + this.baseUrl + '\', \'' + this.applicationPath + '\')"><div TITLE="">Info</div></td>';
										}
										break;
									default:
										html += '<td></td>';
										break;
								}
							}
							else
							{
								html += '<td></td>';
							}
							/*if (actionUser != null && mode == 'approbation')
							{
								html += '<td class="actionUser"><div TITLE="' + actionUser.text + '">' + actionUser.text + '</div></td>';
							}*/
							html += '</tr></table></td>';
														
							html += '</tr>';
						}
						else
						{
							if (cpt == 1)
							{
								html += '<tr id="' + nodeId.text + '_' + currentAction + '_OldActions" style="display:none;"><td></td><td colspan="3"><table border="0" cellpadding="0" cellspacing="0" width="100%">';	
							}
							if (bAlternate)
							{
								html += '<tr class="alternate">';
							}
							else
							{						
								html += '<tr>';
							}
							if (nextAction == currentAction)
							{
								html += '<td width="10"><img src="Images/Tree/T.gif" /></td>';
							}
							else
							{
								html += '<td width="10"><img src="Images/Tree/L.gif" /></td>';
							}
							html += '<td class="actionDate" width="105"><div TITLE="' + actionDate.text + '">' + actionDate.text + '</div></td>';
							html += '<td><table cellpadding="0" cellspacing="0" border="0" width="100%"><tr>';
							html += '<td width="100%" class="actionType"><div TITLE="' + actionType.text + '">' + actionType.text + '</div></td>';
							html += '<td class="actionInfo" onmouseover="this.className=\'actionInfoOver\';" onmouseout="this.className=\'actionInfo\';" onclick="ShowActionInfo(\'' + actionId.text + '\', \'' + this.baseUrl + '\', \'' + this.applicationPath + '\')"><div TITLE="">Info</div></td>';
							/*if (actionUser != null && mode == 'approbation')
							{
								html += '<td class="actionUser"><div TITLE="' + actionUser.text + '">' + actionUser.text + '</div></td>';
							}*/
							html += '</tr></table></td>';
							
							html += '</tr>';
							
							if(actionIdx == actions.length - 1)
							{
								html += '</td></tr></table>';
							}
						}
						cpt++;
						previousAction = currentAction;
						bAlternate = !bAlternate;
					}
					html += '</table>';
					
					html += '</td></tr>';
					html += '</table>';
				}
				
				html += '</td></tr>';
				html += '<tr><td><img src="Images/Transp.gif" width="8" height="8"></td></tr>';
				html += '</table>';
				
				html += '</div>';
				//alert(html);
				//this.currentFields[this.currentFields.length] = new Field(fieldName, 'actionsselector', fieldMandatory == 'true');
				break;
		}
		
		html += '</td>';
		html += '</tr>';
	}
	
	return html;
}

function ShowActionInfo(actionId, baseUrl, applicationPath)
{
	//alert("action info " + actionId);
	//sFeatures = 'height=600px,width=800px,status=no,scrollbars=yes,resizable=yes';
	sFeatures = 'height=150px,width=200px,status=no,scrollbars=yes,resizable=no';
	var result;
	var url;
	/*if(applicationPath.indexOf("Sesame") != -1)
	{
		url = applicationPath + "_Services/ActionInfo.aspx?actionId=";
	}
	else
	{
		url = baseUrl + "ActionInfo.aspx?actionId=";
	}*/
	
	url = applicationPath + "_CMPages/ActionInfo.aspx?actionId=";
	//alert(url);
	window.open(url + actionId, "preview", sFeatures)
}

Wizard.prototype.ValidateCaracters = function ()
{
	var field;

	field = window.event.srcElement;
	
	if (typeof(field.allowedCaracters) != 'undefined')
	{
		if (field.value != 'undefined')
		{
			if (event.keyCode != 8 && typeof(field.maxCaracters) != 'undefined')
			{
				if (field.value.length >= field.maxCaracters)
				{
					window.event.returnValue = false;
				}
			}
		}
		//alert(event.keyCode);
		if (event.keyCode != 8 && field.allowedCaracters.indexOf(String.fromCharCode(event.keyCode)) == -1)
		{
			if (event.keyCode != 16)
			{
				//alert(String.fromCharCode(event.keyCode));
			}
			window.event.returnValue = false;
		}
		else
		{
			if (String.fromCharCode(event.keyCode) == '0')
			{
				//alert(event.keyCode);
			}
		}
	}
}

Wizard.prototype.BeforePaste = function()
{
	window.event.returnValue = false;
}

Wizard.prototype.CheckPaste = function ()
{
	window.event.returnValue = false;
	//alert('test');
	/*var field;
	var car;
	var valueCheck;

	field = window.event.srcElement;
	
	if (typeof(field.allowedCaracters) != 'undefined')
	{
		if (field.value != 'undefined')
		{
			valueCheck = field.value;
			
			for(i=0; i<field.value.length; i++)
			{
				car = field.value.substring(i, i+1);
				if(field.allowedCaracters.indexOf(car) == -1)
				{
					alert("bad car find!");
					valueCheck = valueCheck.replace(/ + car + /g, "")
					alert(valueCheck);
				}
			}
		}
	
	}*/
}

Wizard.prototype.CheckChanges = function ()
{
	var field;
	var oField;
	var fieldRequired;
	var valueCheck;

	fieldRequired = false;

	if (this.currentFields == null)
	{
		return;
	}
	
	for(var i = 0; i < this.currentFields.length; i++)
	{
		oField = this.currentFields[i];
		field = document.all[oField.name];

		if (oField.mandatory && field.value == '')
		{
			fieldRequired = true;
		}
	}

	if (fieldRequired)
	{
		if (this.currentStep < this.steps.length -1)
		{
			document.all["nextButton"].disabled = true;
		}
		if (this.currentStep == this.steps.length -1)
		{
			document.all["finishButton"].disabled = true;
			if (this.bFinish2)
			{
				document.all["finishButton2"].disabled = true;
			}
			if (this.bFinish3)
			{
				document.all["finishButton3"].disabled = true;
			}
		}
	}
	else
	{
		if (this.currentStep < this.steps.length -1)
		{
			document.all["nextButton"].disabled = false;
		}
		if (this.currentStep == this.steps.length -1)
		{
			document.all["finishButton"].disabled = false;
			if (this.bFinish2)
			{
				document.all["finishButton2"].disabled = false;
			}
			if (this.bFinish3)
			{
				document.all["finishButton3"].disabled = false;
			}
		}
	}
	
	field = window.event.srcElement;
	
	if (field != null && typeof(field.allowedCaracters) != 'undefined')
	{
		if (field.value != 'undefined')
		{
			valueCheck = field.value;
			
			for(i=0; i<field.value.length; i++)
			{
				car = field.value.substring(i, i+1);
				if(field.allowedCaracters.indexOf(car) == -1)
				{
					valueCheck = valueCheck.replace(car, "")
				}
			}
			
			field.value = valueCheck;
		}
	
	}
}

Wizard.prototype.SaveFields = function ()
{
	var oField;
	var field;
	var value;
	var fieldNode;
	
	for(var i = 0; i < this.currentFields.length; i++)
	{
		oField = this.currentFields[i];
		field = document.all[oField.name];
		
		if (oField.type == 'checkbox')
		{
			value = field.checked.toString();
		}
		else
		{
			if (oField.type == 'radio')
			{
				if (typeof(field.length) != 'undefined')
				{
					for (var i=0; i<field.length; i++) 
					{
						if (field[i].checked) 
						{
							value = field[i].value;
							break;
						}
					}
				}
				else
				{
					value = field.value;
				}			
			}
			else
			{
				value = field.value;
			}
		}
		
		fieldNode = this.contextDocument.documentElement.selectSingleNode(oField.name);
		
		if (fieldNode != null)
		{
			fieldNode.text = value;
		}
		else
		{
			fieldNode = this.contextDocument.createElement(oField.name);
			
			fieldNode.text = value;
			
			this.contextDocument.documentElement.appendChild(fieldNode);
		}
	}
}

Wizard.prototype.SetFocus = function ()
{
	var oField;
	var field;
	var pos;

	pos = 0;
	
	while (this.currentFields.length > pos)
	{
		oField = this.currentFields[pos++];
		field = document.all[oField.name];

		if (oField.type == 'dropdown' || oField.type == 'text' || oField.type == 'checkbox')
		{
			field.focus();
			pos++;
			break;
		}
		else
		{
			pos++;
		}
	}
}

Wizard.prototype.Execute = function ()
{
	var serviceName;
	var functionName;
	var post;
	var doc;
	var response;
	var responseDocument;
	var status;
	var message;
	
	serviceName = this.wizardDocument.selectSingleNode("/wizard/serviceName");
	functionName = this.wizardDocument.selectSingleNode("/wizard/functionName");
	
	//alert("service name : " + serviceName.text  + " functionName : " + functionName.text);
	if (serviceName != null && functionName != null)
	{
		post = "context=" + encodeURIComponent(this.contextDocument.xml);

		if (serviceName.text.charAt(0) == '/')
		{
			this.xmlHttp.Open("POST", serviceName.text + '/' + functionName.text, false);
		}
		else
		{
			this.xmlHttp.Open("POST", this.baseUrl + serviceName.text + '/' + functionName.text, false);
		}
		this.xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
		this.xmlHttp.Send(post);

		doc = this.xmlHttp.responseXML;

		if (doc.parseError.errorCode != 0 || doc.xml == '')
		{
			document.all["WizardContent"].innerHTML = 'unable to execute request';
		}
		else
		{
			response = doc.documentElement.firstChild.text;
			responseDocument = new ActiveXObject("Msxml2.DOMDocument");
			
			responseDocument.loadXML(response);
			
			if (responseDocument.parseError.errorCode != 0 || responseDocument.xml == '')
			{
				document.all["WizardContent"].innerHTML = 'unable to retrieve read response';
			}
			else
			{
				status = responseDocument.documentElement.firstChild;
				
				message = status.nextSibling;

				if (status.text == 'succeed')
				{
					this.complete = true;
					this.result = message.nextSibling;
					document.all["WizardContent"].innerHTML = '<span class="succeed">' + message.text + '</span>';
					document.all["cellClose"].style.display = '';
					document.all["cellCancel"].style.display = 'none';
				}
				else
				{
					document.all["WizardContent"].innerHTML = '<span class="error">' + message.text + '</span>';
					document.all["cellPrevious"].style.display = '';
				}
			}
		}
	}
	else
	{
		document.all["WizardContent"].innerHTML = '';
	}
}

Wizard.prototype.Execute2 = function ()
{
	var serviceName;
	var functionName;
	var post;
	var doc;
	var response;
	var responseDocument;
	var status;
	var message;
	
	serviceName = this.wizardDocument.selectSingleNode("/wizard/serviceName");
	functionName = this.wizardDocument.selectSingleNode("/wizard/functionName2");

	//alert("service name : " + serviceName.text  + " functionName : " + functionName.text);
	if (serviceName != null && functionName != null)
	{
		post = "context=" + encodeURIComponent(this.contextDocument.xml);

		if (serviceName.text.charAt(0) == '/')
		{
			this.xmlHttp.Open("POST", serviceName.text + '/' + functionName.text, false);
		}
		else
		{
			this.xmlHttp.Open("POST", this.baseUrl + serviceName.text + '/' + functionName.text, false);
		}
		this.xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
		this.xmlHttp.Send(post);

		doc = this.xmlHttp.responseXML;

		if (doc.parseError.errorCode != 0 || doc.xml == '')
		{
			document.all["WizardContent"].innerHTML = 'unable to execute request';
		}
		else
		{
			response = doc.documentElement.firstChild.text;
			responseDocument = new ActiveXObject("Msxml2.DOMDocument");
			
			responseDocument.loadXML(response);
			
			if (responseDocument.parseError.errorCode != 0 || responseDocument.xml == '')
			{
				document.all["WizardContent"].innerHTML = 'unable to retrieve read response';
			}
			else
			{
				status = responseDocument.documentElement.firstChild;
				
				message = status.nextSibling;

				if (status.text == 'succeed')
				{
					this.complete = true;
					this.result = message.nextSibling;
					document.all["WizardContent"].innerHTML = '<span class="succeed">' + message.text + '</span>';
					document.all["cellClose"].style.display = '';
					document.all["cellCancel"].style.display = 'none';
				}
				else
				{
					document.all["WizardContent"].innerHTML = '<span class="error">' + message.text + '</span>';
					document.all["cellPrevious"].style.display = '';
				}
			}
		}
	}
	else
	{
		document.all["WizardContent"].innerHTML = '';
	}
}

Wizard.prototype.Execute3 = function ()
{
	var serviceName;
	var functionName;
	var post;
	var doc;
	var response;
	var responseDocument;
	var status;
	var message;
	
	serviceName = this.wizardDocument.selectSingleNode("/wizard/serviceName");
	functionName = this.wizardDocument.selectSingleNode("/wizard/functionName3");

	//alert("service name : " + serviceName.text  + " functionName : " + functionName.text);
	if (serviceName != null && functionName != null)
	{
		post = "context=" + encodeURIComponent(this.contextDocument.xml);

		if (serviceName.text.charAt(0) == '/')
		{
			this.xmlHttp.Open("POST", serviceName.text + '/' + functionName.text, false);
		}
		else
		{
			this.xmlHttp.Open("POST", this.baseUrl + serviceName.text + '/' + functionName.text, false);
		}
		this.xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
		this.xmlHttp.Send(post);

		doc = this.xmlHttp.responseXML;

		if (doc.parseError.errorCode != 0 || doc.xml == '')
		{
			alert(doc.xml);
			document.all["WizardContent"].innerHTML = 'unable to execute request';
		}
		else
		{
			response = doc.documentElement.firstChild.text;
			responseDocument = new ActiveXObject("Msxml2.DOMDocument");
			
			responseDocument.loadXML(response);
			
			if (responseDocument.parseError.errorCode != 0 || responseDocument.xml == '')
			{
				document.all["WizardContent"].innerHTML = 'unable to retrieve read response';
			}
			else
			{
				status = responseDocument.documentElement.firstChild;
				
				message = status.nextSibling;

				if (status.text == 'succeed')
				{
					this.complete = true;
					this.result = message.nextSibling;
					document.all["WizardContent"].innerHTML = '<span class="succeed">' + message.text + '</span>';
					document.all["cellClose"].style.display = '';
					document.all["cellCancel"].style.display = 'none';
				}
				else
				{
					document.all["WizardContent"].innerHTML = '<span class="error">' + message.text + '</span>';
					document.all["cellPrevious"].style.display = '';
				}
			}
		}
	}
	else
	{
		document.all["WizardContent"].innerHTML = '';
	}
}

Wizard.prototype.MovePrevious = function ()
{
	if (this.currentStep > 0)
	{
		if (this.currentStep < this.steps.length)
		{
			this.SaveFields();
		}
		this.currentStep--;
		this.ShowSteps();
		this.ShowFields();
		this.CheckChanges();
		this.SetFocus();
	}
}

Wizard.prototype.MoveNext = function ()
{
	if (this.currentStep < this.steps.length - 1)
	{
		this.SaveFields();
		this.currentStep++;
		this.ShowSteps();
		this.ShowFields();
		this.CheckChanges();
		this.SetFocus();
	}
}

Wizard.prototype.Finish = function ()
{
	if (this.currentStep == this.steps.length - 1)
	{
		this.SaveFields();
		this.currentStep++;
		this.ShowSteps();
		this.Execute();
	}
}

Wizard.prototype.Finish2 = function ()
{
	if (this.currentStep == this.steps.length - 1)
	{
		this.SaveFields();
		this.currentStep++;
		this.ShowSteps();
		this.Execute2();
	}
}

Wizard.prototype.Finish3 = function ()
{
	if (this.currentStep == this.steps.length - 1)
	{
		this.SaveFields();
		this.currentStep++;
		this.ShowSteps();
		this.Execute3();
	}
}

Wizard.prototype.ShowPageSelector = function()
{
	var result;
	var field;
	var label;
	var value;
	var currentPage;
	var disableNode;

	field = document.all[window.event.srcElement.id.substr(4)];
	
	if (field.value != "")
	{
		currentPage = field.value;
	}
	else
	{
		currentPage = field.initialPosition;
		disableNode = field.disableNode;
		//alert("disableNode " + disableNode);
	}
	//alert(currentPage);
	//alert(this.baseUrl);
	result = window.showModalDialog(this.baseUrl + "PageSelector.aspx?AllowPositionSelection=true&currentPage=" + currentPage + "&disableNode=" + disableNode, null, "dialogHeight: 450px; dialogWidth: 350px; edge: Raised; center: Yes; help: No; scroll:no; resizable: no; status: No;");
	//alert(result.selectedId);
	if (result.returnValue)
	{
		label = document.all["lbl_" + window.event.srcElement.id.substr(4)];

		switch(result.position)
		{
			case "before":
				value = "before:";
				break;
			case "inside":
				value = "inside:";
				break;
			case "after":
				value = "after:";
				break;
		}
		
		value += result.selectedId.substr(3);

		field.value = value;
		label.innerHTML = this.GetPageTitle(value);
		
		this.CheckChanges();
	}
}
			
Wizard.prototype.GetPageTitle = function(selectorValue)
{
	var position;
	var pageId;
	var serviceUri;
	var serviceName;
	var functionName;
	var doc;
	var post;
	var response;
	var responseDocument;
	var status;
	var pageTitle;
	var positionLabel;

	position = selectorValue.substr(0, selectorValue.indexOf(":"));
	pageId = selectorValue.substr(selectorValue.indexOf(":") + 1);
	
	serviceName = this.wizardDocument.selectSingleNode("/wizard/pageSelector/serviceName");
	functionName = this.wizardDocument.selectSingleNode("/wizard/pageSelector/functionName");
	
	pageTitle = '';

	if (serviceName != null && functionName != null)
	{
		post = "pageId=" + encodeURIComponent(pageId);
		//alert(post);
		if (serviceName.text.charAt(0) == '/')
		{
			//alert(serviceName.text + '/' + functionName.text);
			this.xmlHttp.Open("POST", serviceName.text + '/' + functionName.text, false);
		}
		else
		{
			//alert(this.baseUrl + serviceName.text + '/' + functionName.text);
			this.xmlHttp.Open("POST", this.baseUrl + serviceName.text + '/' + functionName.text, false);
		}
		this.xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
		this.xmlHttp.Send(post);

		doc = this.xmlHttp.responseXML;

		if (!(doc.parseError.errorCode != 0 || doc.xml == ''))
		{
			response = doc.documentElement.firstChild.text;
			responseDocument = new ActiveXObject("Msxml2.DOMDocument");
			
			responseDocument.loadXML(response);
			
			if (!(responseDocument.parseError.errorCode != 0 || responseDocument.xml == ''))
			{
				status = responseDocument.documentElement.firstChild;

				if (status.text == 'succeed')
				{
					pageTitle = status.nextSibling.text;
				}
			}
		}
	}
	
	if (pageTitle != '')
	{
		positionLabel = this.wizardDocument.selectSingleNode("/wizard/pageSelector/positions/" + position + "/labels/" + this.language);

		if (positionLabel == null)
		{
			positionLabel = this.wizardDocument.selectSingleNode("/wizard/pageSelector/positions/" + position + "/label");
		}
		
		if (positionLabel != null)
		{
			return '<span class="text">' + positionLabel.text + ' "<span class="label">' + pageTitle + '</span>"</span><br>';
		}
	}
	//alert(pageTitle);
	return '';
}

Wizard.prototype.ActionChecked = function(fieldName)
{
	var src;
	var nodeId;
	var box;
	
	src = event.srcElement;
	
	//uncheck global site checkbox
	if(!src.checked)
	{
		obj = document.all["chk_websiteActions"];
		if(obj != undefined)
		{
			obj.checked = false;
		}
	}

	if (!src.checked)
	{
		nodeId = src.nodeId;
		
		box = document.all['chk_' + nodeId];
		
		if (box != null)
		{
			box.checked = false;
		}
	}
	
	row = src.parentElement.parentElement;
	
	type = src.actionDate
	
	if (type == 'lastAction')
	{
		row = row.nextSibling;
		if (row != null)
		{	
			if (row.id != '')
			{
				boxes = row.getElementsByTagName("INPUT");
				
				for(var idx = 0; idx < boxes.length; idx++)
				{
					boxes[idx].checked = src.checked;
				}
			}
		}
	}
	else
	{	
		if(!src.checked)
		{
			boxes = row.parentElement.parentElement.parentElement.parentElement.previousSibling.getElementsByTagName("INPUT");
				
			for(var idx = 0; idx < boxes.length; idx++)
			{
				boxes[idx].checked = src.checked;
			}
			
			row = row.previousSibling;
			
			if (row != null)
			{	
				while (row != null)
				{
					boxes = row.getElementsByTagName("INPUT");
					for(var idx = 0; idx < boxes.length; idx++)
					{
						boxes[idx].checked = src.checked;
					}
					row = row.previousSibling;
				}
			}
		}		
		else
		{
			row = row.nextSibling;
			while (row != null)
			{
				boxes = row.getElementsByTagName("INPUT");
				for(var idx = 0; idx < boxes.length; idx++)
				{
					boxes[idx].checked = src.checked;
				}
				row = row.nextSibling;
			}
		}
	}
	this.UpdateActionField(fieldName);
}

Wizard.prototype.ShowAllActions = function(id, objImg)
{
	var objTr
	
	objTr = document.all[id + '_OldActions'];
	if (objTr != null)
	{
		if (objTr.style.display == '')
		{
			objTr.style.display = 'none';
			objImg.src = 'Images/Tree/Rplus.gif';
		}
		else
		{
			objTr.style.display = '';
			objImg.src = 'Images/Tree/Rminus.gif';
		}
	}
}

Wizard.prototype.SelectNodeActions = function(fieldName)
{
	var src;
	var row;
	var boxes;
	var obj;
	
	src = event.srcElement;

	row = src.parentElement.parentElement;
	
	row = row.nextSibling;
	
	if (row != null)
	{	
		boxes = row.getElementsByTagName("INPUT");
		
		for(var idx = 0; idx < boxes.length; idx++)
		{
			boxes[idx].checked = src.checked;
		}
	}
	
	if(!src.checked)
	{
		obj = document.all["chk_websiteActions"];
		if(obj != undefined)
		{
			obj.checked = false;
		}
	}
	
	this.UpdateActionField(fieldName);
}

Wizard.prototype.UpdateActionField = function(fieldName)
{
	var inputField;
	var actionsDiv;
	var boxes;
	var selectedActions;
	
	inputField = document.all[fieldName];
	actionsDiv = document.all['actionsDiv'];
	
	selectedActions = "";
	if (inputField != null && actionsDiv != null)
	{
		boxes = actionsDiv.getElementsByTagName("INPUT");

		for(var idx = 0; idx < boxes.length; idx++)
		{
			if (typeof(boxes[idx].actionId) != 'undefined' && boxes[idx].checked)
			{
				if (selectedActions != "")
				{
					 selectedActions += ";";
				}
				selectedActions += boxes[idx].nodeId + '!' + boxes[idx].actionId;
			}
		}

		inputField.value = selectedActions;
		
	}
	
	this.CheckChanges();
}
